<template>
  <div class="pop-container" v-bind:class="{on:is_show_pop}">
      <div class="mask" v-on:click="close" v-bind:class="{on:is_show}"></div>
      <div class="content" v-bind:class="{on:is_show}">
          <img class="avatar" src="../../assets/avatar.jpg">
          <div class="user-name">Masky</div>
          <div class="nav-list">
              <a class="item" href="#/order-list"><img src="../../assets/order.png">我的订单</a>
              <a class="item" href="#/favorite"><img src="../../assets/favorite.png">收藏列表</a>
              <a class="item" href="#/message"><img src="../../assets/msg.png">消息盒子</a>
              <a class="item" href="#/profile"><img src="../../assets/account.png">账户信息</a>
          </div>
          <div class="bottom-panel">
              <a class="text-red"><img src="../../assets/logout.png">注销</a>
          </div>
      </div>
  </div>
</template>

<script>
export default {
    name: 'left_panel',
    data () {
        return {
			is_show:false,
            is_show_pop:false
        }
    },
    methods:{
        close:function ()
		{
			let self=this;
			this.is_show=false;
			setTimeout(function () {
				self.is_show_pop=false;
			},300);
		},
        show:function ()
		{
			let self=this;
			self.is_show_pop=true;
			setTimeout(function () {
				self.is_show=true
			},30);

		}
    }

}
</script>

<style scoped>
    .nav-list{
        width: 100%;
        margin-top: 20px;
    }
    .nav-list .item{
        padding: 13px;
        padding-left: 30px;
        display: block;
    }
    .nav-list .item img{
        height: 18px;
        width: 18px;
        vertical-align: middle;
        margin-right: 15px;
    }
    .bottom-panel{
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        overflow: hidden;
    }
    .bottom-panel a{
        display: block;
        float: left;
        width: 50%;
        padding: 15px;
        text-align: center;
    }
    .bottom-panel a img{
        height: 16px;
        width: 16px;
        vertical-align: middle;
        margin-right: 15px;
    }
    .avatar{
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin: 0 auto;
        display: block;
        border: 1px solid #999;
        margin-top: 20px;
    }
    .user-name{
        text-align: center;
        padding: 10px 0;
        font-weight: bold;
    }
    .pop-container{
        position: fixed;
        width: 100%;
        height: 100%;
        top:0;
        left: 0;
        z-index: 999;
        display: none;
        opacity: 1;
        transition: 0.3s opacity ease-out;
    }
    .pop-container .mask{
        position: absolute;
        width: 100%;
        height: 100%;
        top:0;
        left: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1;
        opacity: 0;
        transition: 0.3s all ease-out;
    }
    .pop-container .mask.on{
        opacity: 1;
    }
    .content{
        position: absolute;
        background: #fff;
        width: 60%;
        height: 100%;
        left: -60%;
        top:0;
        z-index: 2;
        box-shadow: 0 0 15px #555;
        transition: 0.3s all ease-out;
    }
    .pop-container.on{
       display: block;
    }
    .pop-container .content.on{
        left: 0;
    }

</style>
